<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCreditsRulesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('credits_rules', function (Blueprint $table) {
            $table->increments('rule_id')->comment('主键');
            $table->string('name', 20)->comment('策略名称')->unique();
            $table->integer('cycle_type')->comment('循环类型: 0->无限, 1->sec, 2->mon, 3->hor, 4->day, 5->week, 6->mounth, 7->year')->default(0);
            $table->integer('times')->comment('周期内次数')->default(1);
            $table->integer('credits')->comment('增加的积分数')->default(1);
            $table->integer('admin_id')->comment('管理员ID');
            $table->string('admin_name', 20)->comment('管理员真实姓名');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('credits_rules');
    }
}
